/// 客户模型
class Contact {
  final String? id;
  final String carCode;
  final String name;
  final String tel;
  final String? carType;
  final String? owner;
  final String? insertTime;
  final String? isBindWeixin;
  final String? weixinOpenid;
  final String? vin;
  final String? carRegisterTime;
  final String? headUrl;
  final String? safeCompany;
  final String? safeNextTime;
  final String? yearCheckNextTime;
  final String? tqTime1;
  final String? tqTime2;
  final String? carKey;
  final String? isVip;
  final String? carId;
  final String? safeCompany3;
  final String? safeNextTime3;
  final String? tqTime3;
  final String? safeTipTime3;

  Contact({
    this.id,
    required this.carCode,
    required this.name,
    required this.tel,
    this.carType,
    this.owner,
    this.insertTime,
    this.isBindWeixin,
    this.weixinOpenid,
    this.vin,
    this.carRegisterTime,
    this.headUrl,
    this.safeCompany,
    this.safeNextTime,
    this.yearCheckNextTime,
    this.tqTime1,
    this.tqTime2,
    this.carKey,
    this.isVip,
    this.carId,
    this.safeCompany3,
    this.safeNextTime3,
    this.tqTime3,
    this.safeTipTime3,
  });

  factory Contact.fromJson(Map<String, dynamic> json) {
    return Contact(
      id: json['_id']?.toString(),
      carCode: json['carcode']?.toString() ?? '',
      name: json['name']?.toString() ?? '',
      tel: json['tel']?.toString() ?? '',
      carType: json['cartype']?.toString(),
      owner: json['owner']?.toString(),
      insertTime: json['inserttime']?.toString(),
      isBindWeixin: json['isbindweixin']?.toString(),
      weixinOpenid: json['weixinopenid']?.toString(),
      vin: json['vin']?.toString(),
      carRegisterTime: json['carregistertime']?.toString(),
      headUrl: json['headurl']?.toString(),
      safeCompany: json['safecompany']?.toString(),
      safeNextTime: json['safenexttime']?.toString(),
      yearCheckNextTime: json['yearchecknexttime']?.toString(),
      tqTime1: json['tqTime1']?.toString(),
      tqTime2: json['tqTime2']?.toString(),
      carKey: json['key']?.toString(),
      isVip: json['isVip']?.toString(),
      carId: json['carId']?.toString(),
      safeCompany3: json['safecompany3']?.toString(),
      safeNextTime3: json['safenexttime3']?.toString(),
      tqTime3: json['tqTime3']?.toString(),
      safeTipTime3: json['safetiptime3']?.toString(),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      '_id': id,
      'carcode': carCode,
      'name': name,
      'tel': tel,
      'cartype': carType,
      'owner': owner,
      'inserttime': insertTime,
      'isbindweixin': isBindWeixin,
      'weixinopenid': weixinOpenid,
      'vin': vin,
      'carregistertime': carRegisterTime,
      'headurl': headUrl,
      'safecompany': safeCompany,
      'safenexttime': safeNextTime,
      'yearchecknexttime': yearCheckNextTime,
      'tqTime1': tqTime1,
      'tqTime2': tqTime2,
      'key': carKey,
      'isVip': isVip,
      'carId': carId,
      'safecompany3': safeCompany3,
      'safenexttime3': safeNextTime3,
      'tqTime3': tqTime3,
      'safetiptime3': safeTipTime3,
    };
  }
}